#!/usr/bin/python
# -*- coding: UTF-8 -*-

import tkinter as tk
from tkinter import messagebox

# 创建窗体
window = tk.Tk()
window.title('Tk Demo')
window.geometry('350x500')


def click():
    messagebox.showinfo(title='info', message='hi')
    messagebox.showerror(title='error', message='error')

    yes_no = messagebox.askquestion(title='ask', message='yes or no ?')
    print(yes_no)

    yes_no = messagebox.askyesno(title='ask', message='yes or no ?')
    print(yes_no)

    pass


tk.Button(window, text="click", command=click).pack()

window.mainloop()

